<!DOCTYPE html>
<html lang="Zh-CN">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>采购订单详情</title>
        <!-- plugins:css -->
        <link rel="stylesheet" href="/static/vendors/mdi/css/materialdesignicons.min.css">
        <link rel="stylesheet" href="/static/vendors/base/vendor.bundle.base.css">
        <!-- endinject -->
        <!-- plugin css for this page -->
        <link rel="stylesheet" href="/static/vendors/datatables.net-bs4/dataTables.bootstrap4.css">
        <!-- End plugin css for this page -->
        <!-- inject:css -->
        <link rel="stylesheet" href="/static/css/style.css">
        <!-- endinject -->
        <link rel="shortcut icon" href="/static/images/favicon.png" />
    </head>
    <body>
        <div class="container-scroller">
            <nav class="navbar col-lg-12 col-12 p-0 d-flex flex-row fixed-top">
                <div class="navbar-brand-wrapper d-flex justify-content-center">
                  <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">  
                    <a class="navbar-brand brand-logo" href="{%url 'login:index1' %}"><img src="/static/images/logo.svg" alt="logo"/></a>
                    <a class="navbar-brand brand-logo-mini" href="{%url 'login:index1' %}"><img src="/static/images/logo-mini.svg" alt="logo"/></a>
                    <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
                      <span class="mdi mdi-sort-variant">
                      </span>
                    </button>
                  </div>  
                </div>
                <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
                  <ul class="navbar-nav navbar-nav-right">
                    <li class="nav-item dropdown me-4">
                      <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center notification-dropdown" id="notificationDropdown" href="#" data-bs-toggle="dropdown">
                        <i class="mdi mdi-bell mx-0"></i>
                        <span class="count"></span>
                      </a>
                      <div class="dropdown-menu dropdown-menu-right navbar-dropdown" 
                      aria-labelledby="notificationDropdown">
                        <p class="mb-0 font-weight-normal float-left dropdown-header">待办通知</p>
                        <a class="dropdown-item">
                          <div class="item-thumbnail">
                            <div class="item-icon bg-success">
                              <i class="mdi mdi-information mx-0"></i>
                            </div>
                          </div>
                          <div class="item-content">
                            <h6 class="font-weight-normal">未处理事务</h6>
                            <p class="font-weight-light small-text mb-0 text-muted">
                              您有未处理的订单
                            </p>
                          </div>
                        </a>
                      </div>
                    </li>
                    <li class="nav-item nav-profile dropdown">
                      <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" 
                      id="profileDropdown">
                        <img src="/static/images/faces/face-czw.jpg" alt="profile">
                        <span class="nav-profile-name">赤之王</span>
                      </a>
                      <div class="dropdown-menu dropdown-menu-right navbar-dropdown" 
                      aria-labelledby="profileDropdown">
                        <a class="dropdown-item">
                          <i class="mdi mdi-settings text-primary"></i>
                          账户设置
                        </a>
                        <a class="dropdown-item">
                          <i class="mdi mdi-logout text-primary"></i>
                          下班！
                        </a>
                      </div>
                    </li>
                  </ul>
                  <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
                    <span class="mdi mdi-menu"></span>
                  </button>
                </div>
            </nav>
            <div class="container-fluid page-body-wrapper pt-0 proBanner-padding-top">
                <nav class="sidebar sidebar-offcanvas active" id="sidebar">
                    <ul class="nav">
                      <li class="nav-item">
                        <a class="nav-link" href="{% url 'proc:index_views' %}">
                          <i class="mdi mdi-home menu-icon"></i>
                          <span class="menu-title">采购管理中台</span>
                        </a>
                      </li>
                    </ul>
                </nav>
                <div class="main-panel">
                    <div class="content-wrapper">
                        <!--订单详情表单-->
                        <div class="col-md-12 grid-margin stretch-card">
                            <div class="card">
                              <div class="card-body">
                                <h1 class="card-title">订单详情</h1>
                                <p class="card-description">
                                  这是一个采购订单
                                </p>
                                <form name="form1" method="POST">
                                    {% csrf_token %}
                                  <div class="form-group row">
                                    <label for="exampleGetOrderNumber" class="col-sm-3 col-form-label">订单号</label>
                                    <div class="col-sm-9">
                                      <input type="text" class="form-control" name = 'p_id' value="{{plan.procure.procure_id}}"
                                      id="exampleGetOrderNumber" placeholder="这是订单号" >
                                    </div>
                                  </div>
                                  <div class="form-group row">
                                    <label for="exampleGetThing" class="col-sm-3 col-form-label">采购商品</label>
                                    <div class="col-sm-9">
                                      <input type="text" class="form-control" value="{{plan.procure_content}}"
                                      id="exampleGetThing" placeholder="采购的商品品名">
                                    </div>
                                  </div>
                                  <div class="form-group row">
                                    <label for="exampleGetThingId" class="col-sm-3 col-form-label">采购原则</label>
                                    <div class="col-sm-9">
                                      <input type="text" class="form-control" value="{{plan.procure_rule}}"
                                      id="exampleGetThingId" placeholder="采购的原则">
                                    </div>
                                  </div>
                                  <div class="form-group row">
                                    <label for="exampleGetTotalSum" class="col-sm-3 col-form-label">采购量</label>
                                    <div class="col-sm-9">
                                      <input type="number" class="form-control" value="{{plan.procure.request_num}}"
                                      id="exampleGetTotalSum" placeholder="采购商品数量">
                                    </div>
                                  </div>
                                  <div id="radioDiv" class="form-group row">
                                    <label class="col-sm-3 col-form-label">审&nbsp;批&nbsp;结&nbsp;果&nbsp; </label>
                                    <div class="col-sm-9">
                                    <label class="form-control">
                                        <input type="radio"  value="是" name="permit"
                                      id="OrderIsComfirmed1" onclick="checkedOrNot(this);">通过
                                    </label>
                                    <label class="form-control">
                                    <input type="radio" value="否" name="permit"
                                      id="OrderIsComfirmed2" onclick="checkedOrNot(this);">否定
                                    </label>
                                    </div>
                                    <i class="input-helper"></i>
                                  </div>
                                  <!--div align="left" style="float:left">
                                    <input type="button" onclick="act1()" value="获取订单信息" class="btn btn-primary me-2">
                                  </div>
                                  <div align="right">
                                    <input type="button" id="ConfirmBtn" onclick="act2()" value="提交确认信息" class="btn btn-primary me-2" disabled>
                                  </div-->
                                  <td>
                                    <input type="button" onclick="act1()" value="获取订单信息" class="btn btn-primary me-2">
                                    <input type="button" id="ConfirmBtn" onclick="act2()" value="提交确认信息" class="btn btn-primary me-2" disabled>
                                  </td>
                                </form>
                              </div>
                            </div>
                        </div>
                    </div>
                    <footer class="footer">
                        <div class="d-sm-flex justify-content-center justify-content-sm-between">
                          <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">
                            Copyright © 
                            <a href="https://www.bootstrapdash.com/" target="_blank">bootstrapdash.com </a>
                            2021
                          </span>
                          <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center">
                            Only the best <a href="https://www.bootstrapdash.com/" target="_blank"> Bootstrap dashboard  </a> 
                            templates
                          </span>
                        </div>
                    </footer>
                </div>
            </div>
        </div>
    <!-- plugins:js -->
    <script src="/static/vendors/base/vendor.bundle.base.js"></script>
    <!-- endinject -->
    <!-- Plugin js for this page-->
    <script src="/static/vendors/chart.js/Chart.min.js"></script>
    <script src="/static/vendors/datatables.net/jquery.dataTables.js"></script>
    <script src="/static/vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script>
    <!-- End plugin js for this page-->
    <!-- inject:js -->
    <script src="/static/js/off-canvas.js"></script>
    <script src="/static/js/hoverable-collapse.js"></script>
    <script src="/static/js/template.js"></script>
    <!-- endinject -->
    <!-- Custom js for this page-->
    <script src="/static/js/dashboard.js"></script>
    <script src="/static/js/data-table.js"></script>
    <script src="/static/js/jquery.dataTables.js"></script>
    <script src="/static/js/dataTables.bootstrap4.js"></script>
    <script src="/static/js/file-upload.js"></script>
    <script>
      function checkedOrNot(checkbox){
          var btn = document.getElementById("ConfirmBtn");
          var choice = checkbox.checked;
          if (choice){
              btn.removeAttribute("disabled");
          }
          else{
              btn.setAttribute('disabled', true);
          }
      }
    </script>
    <!-- End custom js for this page-->
    <script type="text/javascript">
     function act1(){
              document.form1.action="{% url 'proc:get_plan' %}";
              document.form1.submit();
       }
     function act2(){
              document.form1.action="{% url 'proc:check_plan' %}";
              document.form1.submit();
       }
    </script>
    <script>

			$("#radioDiv input[type='radio']").click(function(){
				//1.先移除之前元素的checked
				$("#radioDiv input[type='radio']:checked").removeAttr("checked");

				//2.给当前点击的单选框加checked
				$(this).attr("checked","true")

				//3.测试打印值
				console.log($("#radioDiv input[type='radio']:checked").val())

			})

    </script>



    <script src="/static/js/jquery.cookie.js" type="text/javascript"></script>
    </body>
</html>